Prevent the execution of refreshDraftOrderAdjustmentsWorkflow when not a draft order#14753
Conversation
…when not a draft order
🦋 Changeset detectedLatest commit: c0c7817 The changes in this PR will be included in the next version bump. This PR includes changesets to release 76 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ts-when-not-draft-order
|
@pepijn-vanvlaanderen is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey @pepijn-vanvlaanderen I want to understand a little bit more the issue you are describing of line item adjustments being removed. The workflow removes but re-adds adjustments, provided that they are still valid for the order. Can you expand a little bit more about what these adjustments are, since I don't believe it is tied to the order being or not a draft order. |
|
Hi @NicolasGorga, thanks for your reply. The line items that are passed are custom adjustments for our subscription items, not tied to a specific promotion. In this case these are thus not re-added again. |
|
@pepijn-vanvlaanderen can you expand on these custom line items? We are talking about line item adjustments not line items right? Could you maybe share the JSON of how the order looks like before the |
Summary
What — What changes are introduced in this PR?
Only trigger the refreshDraftOrderAdjustmentsWorkflow in the create order workflow when it is actually a draft order.
Why — Why are these changes relevant or necessary?
When using the create order workflow (we use it when creating subscription renewal orders) with custom line item adjustments, the refreshDraftOrderAdjustmentsWorkflow workflow will remove them.
How — How have these changes been implemented?
Wrapped the refreshDraftOrderAdjustmentsWorkflow in a when check.
Testing — How have these changes been tested, or how can the reviewer test the feature?
Patchted it for our project(s). Validated this is still triggered when doing draft order changes.
Checklist
Please ensure the following before requesting a review:
yarn changesetand follow the prompts